package com.gwcm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gwcm.model.dto.user.UserQueryRequest;
import com.gwcm.model.entity.User;
import com.gwcm.model.vo.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 15375
* @description 针对表【sys_user(用户表)】的数据库操作Mapper
* @createDate 2023-02-28 20:12:05
* @Entity com.gwcm.model.entity.User
*/
public interface UserMapper extends BaseMapper<User> {

    IPage<UserVo> selectUserToPage(IPage<User> page, @Param("userQueryRequest") UserQueryRequest userQueryRequest);

    /**
     * 根据ID查询user
     * @param userId
     * @return
     */
    User selectUserById(Long userId);

    /**
     * 根据userName查询user
     * @param username
     * @return
     */
    User selectUserByUsername(String username);

    /**
     * 查询user集合
     * @param user
     * @return
     */
    List<User> selectUserList(User user);

//    /**
//     * 删除用户
//     * @param userId
//     * @return
//     */
//    int deleteUserById(Long userId);

//    /**
//     * 新增用户
//     * @param user
//     * @return
//     */
//    int insertUser(User user);

    /**
     * 更新用户
     * @param user
     * @return
     */
    int updateUser(User user);

    /**
     * 检查用户昵称是否唯一
     * @param nickname
     * @return
     */
    int checkNicknameUnique(String nickname);
}




